package com.tbm.repository;

import com.tbm.entity.SystemUser;
import com.tbm.entity.UserEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2017/8/21.
 */
public interface SystemUserRepository extends JpaRepository<SystemUser,Integer> {
    SystemUser findByUserName(String userName);

    @Query(value = "select u.user_id,u.user_name,u.display_name,u.is_lock,u.phone,u.email,r.role_id,r.role_name,r.rights from sys_user u,sys_role r where u.role_id = r.role_id",nativeQuery = true)
    List<Object> findAllSystemUserAndRole();


}
